﻿{% extends 'base/front_base.html' %}
{% load news_filters %}
{% block title %}
	新闻搜索 - 小饭桌
{% endblock %}

{% block head %}
	<link rel="stylesheet" href="{% static 'css/news/search.min.css' %}">
{% endblock %}

{% block main %}
	<div class="main">
		<div class="wrapper">
			<div class="main-content-wrapper">
				<div class="search-group">
					<div class="search-box">
						<form action="{% url 'news:search' %}" method="get">
							{% csrf_token %}
							<div class="input-area"><input type="text" name="keywords" placeholder="可输入新闻关键字、作者名字搜索"></div>
							<div class="submit_btn"><input type="submit" name="submit" value="搜索" ></div>
						</form>
					</div>
				</div>
				<div class="list-outer-group">
					{% if result %}
						<p class="list-title">搜索结果</p>
						<ul class="list-inner-group">
						{% for news in result %}
							<li>
								<div class="thumbnail-group">
									<a href="#">
										<img src="{{ news.thumbnail }}" alt="Alternate Text" />
									</a>
								</div>
								<div class="news-group">
									<p class="title">{{ news.title }}</p>
									<p class="desc">{{ news.desc }}</p>
									<p class="more">
										<span class="keywords">
											{{news.category}}
										</span>
										<span class="pub-time">{{ news.pub_time|time_since }}</span>
										<span class="author">{{ news.author.name }}</span>
									</p>
								</div>
							</li>
						{% endfor %}
						</ul>
					{% else %}
						<p class="list-title">热门推荐</p>
						<ul class="list-inner-group">
							<li>
								<div class="thumbnail-group">
									<a href="#">
										<img src="{% static 'images/news-list-1.jpg'%}" alt="Alternate Text" />
									</a>
								</div>
								<div class="news-group">
									<p class="title">早报：网易、京东确定二次上市日期；韵达战略投资德邦；SpaceX本周将进行首次载人飞行</p>
									<p class="desc">周鸿祎：企业要积极关注市场变化，想尝试直播带货</p>
									<p class="more">
										<span class="keywords">
											<label>韵达</label>
											<label>SpaceX</label>
											<label>京东香港上市</label>
											<label>网易香港上市</label>
										</span>
										<span class="pub-time">05月25日</span>
										<span class="author">史素云</span>
									</p>
								</div>
							</li>
							<li>
								<div class="thumbnail-group">
									<a href="#">
										<img src="{% static 'images/1590283766_163.jpg-website.news.list'%}" alt="Alternate Text" />
									</a>
								</div>
								<div class="news-group">
									<p class="title">早报：美国制裁33家中国公司和机构；董明珠和雷军续赌约;人大代表建议禁止生产销售电子烟</p>
									<p class="desc">途牛股价连续低于1美元收纳斯达克通知函</p>
									<p class="more">
										<span class="keywords">
											<label>中美</label>
											<label>董明珠</label>
											<label>华为</label>
										</span>
										<span class="pub-time">05月24日</span>
										<span class="author">柴容</span>
									</p>
								</div>
							</li>
						</ul>
					{% endif %}
				</div>
			</div>
			{% include 'common/sidebar.html' %}
		</div>
	</div>
{% endblock %}
